package com.swiot.biz.constants;

/**
 * 模板相关常量
 *
 * @author kingdom
 * @date 2025-08-26
 */
public class TemplateConstants {

    /**
     * 默认分组名称
     */
    public static final String DEFAULT_GROUP_NAME = "默认分组";

    /**
     * 默认表名前缀
     */
    public static final String DEFAULT_TABLE_PREFIX = "biz_";

    /**
     * 默认表名后缀
     */
    public static final String DEFAULT_TABLE_SUFFIX = "data_";
    /**
     * 默认告警表名后缀
     */
    public static final String DEFAULT_ALARM_SUFFIX = "alarm_";
    /**
     * 默认提醒表名后缀
     */
    public static final String DEFAULT_REMIND_SUFFIX = "remind_";

    /**
     * 字段分隔符
     */
    public static final String FIELD_SEPARATOR = ",";

    /**
     * 行列分隔符
     */
    public static final String ROW_COL_SEPARATOR = ":";

    /**
     * 默认年后缀
     */
    public static final String DEFAULT_YEAR_SUFFIX = "99";

    /**
     * 预算后缀
     */
    public static final String DEFAULT_BUDGET_SUFFIX = "00";

    /**
     * 数据类型
     */
    public static class DataType{
        public static final String BUDGET = "00";
        public static final String YEAR = "99";
    }

    /**
     * 告警规则常量
     */
    public static class AlarmRules {
        public static final String RULE = "alarmRule";  // 检查范围值
        public static final String RULE_FUNC="alarmRule:func";
        public static final String RULE_PARAM="alarmRule:param";
        public static final String RULE_ID="alarmRule:id";
        public static final String CHECK_RANGE_VALUE = "alarmRule:func:checkRangeValue";  // 检查范围值
        public static final String CHECK_RANGE_PERCENT = "alarmRule:func:checkRangePercent";  // 检查范围百分比
    }

    /**
     * 发布状态常量
     */
    public static class PublishStatus {
        public static final Long UNPUBLISHED = 0L;  // 未发布
        public static final Long PUBLISHED = 1L;     // 已发布
    }

    /**
     * 规则状态常量
     */
    public static class RuleStatus {
        public static final Integer ENABLE = 1;
        public static final Integer DISABLE = 0;
    }

    public static class DeleteStatus {
        public static final String DELETED = "2";
        public static final String NORMAL = "0";
    }
    /**
     * 错误消息常量
     */
    public static class ErrorMessages {
        public static final String TEMPLATE_ID_EMPTY = "模板ID不能为空";
        public static final String TEMPLATE_NOT_EXISTS = "模板不存在";
        public static final String PUBLISH_STATUS_EMPTY = "发布状态不能为空";
        public static final String INVALID_PUBLISH_STATUS = "无效的发布状态";
        public static final String TEMPLATE_NAME_EMPTY = "模板名称不能为空";
        public static final String TEMPLATE_TABLE_EMPTY = "模板表名不能为空";
        public static final String TEMPLATE_DESCRIPTION_EMPTY = "模板描述不能为空";
        public static final String TEMPLATE_CONTENT_EMPTY = "模板内容不能为空";
        public static final String FIELD_ROW_COL_EMPTY = "字段行列不能为空";
        public static final String DATA_ROW_COL_EMPTY = "数据行列不能为空";
        public static final String ALARM_ROW_COL_EMPTY = "告警行列不能为空";
        public static final String ROW_COL_FORMAT_ERROR = "行列格式错误，应为'行:列'格式";
        public static final String JSON_PARSE_ERROR = "模板内容不是有效的JSON格式";
        public static final String CELLDATA_NOT_FOUND = "未找到data数组或工作表数据";
        public static final String POSITION_NOT_FOUND = "未找到指定行列的数据";
        public static final String CREATE_TABLE_FAILED = "创建表失败";
        public static final String PARSE_TEMPLATE_FAILED = "解析模板数据失败";
        public static final String DUPLICATE_FIELDS_ERROR = "字段存在重复，请检查字段名称的唯一性";
        public static final String REPORT_DATE_EMPTY = "报告日期不能为空";
        public static final String DEPT_ID_EMPTY = "部门ID不能为空";
        public static final String DEPT_NOT_EXISTS = "部门不存在";
        public static final String GROUP_NAME_EMPTY = "分组名称不能为空";
    }
}
